home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 5 / BBS in a Box -Volume V (BBS in a Box) (April 1992).iso / Files / Hyper / D / DateMatcher.cpt / DateMatcher / background_2745.txt < prev    next >
Encoding:
Text File  |  1990-02-09  |  5.6 KB  |  219 lines

  1. -- background: 2745 from stack: in
  2. -- bmap block id: 3260
  3. -- flags: 0000
  4. -- background id: 0
  5. -- name: 
  6.  
  7.  
  8. -- part 2 (button)
  9. -- low flags: 00
  10. -- high flags: 2000
  11. -- rect: left=68 top=103 right=121 bottom=213
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Read Me First
  20. ----- HyperTalk script -----
  21. on mouseUp
  22.   visual effect scroll down
  23.   go to card "Read Me First"
  24. end mouseUp
  25.  
  26.  
  27.  
  28. -- part 3 (button)
  29. -- low flags: 00
  30. -- high flags: 2000
  31. -- rect: left=68 top=121 right=140 bottom=213
  32. -- title width / last selected line: 0
  33. -- icon id / first selected line: 0 / 0
  34. -- text alignment: 1
  35. -- font id: 0
  36. -- text size: 12
  37. -- style flags: 0
  38. -- line height: 16
  39. -- part name: Important Information
  40. ----- HyperTalk script -----
  41. on mouseUp
  42.   visual effect scroll down
  43.   go card "Important Information"
  44. end mouseUp
  45.  
  46.  
  47.  
  48. -- part 4 (button)
  49. -- low flags: 00
  50. -- high flags: 2000
  51. -- rect: left=68 top=140 right=158 bottom=213
  52. -- title width / last selected line: 0
  53. -- icon id / first selected line: 0 / 0
  54. -- text alignment: 1
  55. -- font id: 0
  56. -- text size: 12
  57. -- style flags: 0
  58. -- line height: 16
  59. -- part name: Instructions
  60. ----- HyperTalk script -----
  61. on mouseUp
  62.   visual effect scroll down
  63.   go card "Instructions"
  64. end mouseUp
  65.  
  66.  
  67.  
  68. -- part 5 (button)
  69. -- low flags: 00
  70. -- high flags: 2000
  71. -- rect: left=295 top=210 right=227 bottom=436
  72. -- title width / last selected line: 0
  73. -- icon id / first selected line: 0 / 0
  74. -- text alignment: 1
  75. -- font id: 0
  76. -- text size: 12
  77. -- style flags: 0
  78. -- line height: 16
  79. -- part name: Edit Database
  80. ----- HyperTalk script -----
  81. on mouseUp
  82.   push card
  83.   answer "Please open the database stack." with "Okay"
  84.   domenu "open stack..."
  85.   get the script of this stack
  86.   if it is not "DATABASE" then
  87.     answer "Sorry, that is not a database stack for this program." with "Okay"
  88.     pop card
  89.   end if
  90. end mouseUp
  91.  
  92.  
  93.  
  94. -- part 6 (button)
  95. -- low flags: 00
  96. -- high flags: 2000
  97. -- rect: left=295 top=227 right=246 bottom=436
  98. -- title width / last selected line: 0
  99. -- icon id / first selected line: 0 / 0
  100. -- text alignment: 1
  101. -- font id: 0
  102. -- text size: 12
  103. -- style flags: 0
  104. -- line height: 16
  105. -- part name: Determine Results
  106. ----- HyperTalk script -----
  107. on mouseUp
  108.   push card
  109.   answer "Print results after calculation?" with "Cancel" or "Yes"or "No"
  110.   global pRESULTS
  111.   if it is "Yes" then put "Y" into pRESULTS
  112.   if it is not "Cancel" then
  113.     answer "Please open the database stack." with "Okay"
  114.     domenu "open stack..."
  115.     get the script of this stack
  116.     set lockscreen to true
  117.     if it is "DATABASE" then
  118.       repeat for the number of cards
  119.         go next
  120.         put return&return&return&return&return into bkgnd fld "matches"
  121.       end repeat
  122.       repeat with x=1 to the number of cards
  123.         go card x
  124.         put x into y
  125.         getPresentCard
  126.         repeat until y=the number of cards
  127.           add 1 to y
  128.           put "Current person: "&x&" Matching: "&y
  129.           go card y
  130.           calculateResults
  131.         end repeat
  132.         global currentMatches
  133.         go card x
  134.         put currentMatches into bkgnd fld "matches"
  135.       end repeat
  136.       if pRESULTS contains "Y" then
  137.         go first
  138.         repeat for the number of cards
  139.           click at the loc of bkgnd btn "Print"
  140.           click at the loc of bkgnd fld "Results"
  141.           go next
  142.         end repeat
  143.       end if
  144.     end if
  145.   end if
  146.   pop card
  147. end mouseUp
  148.  
  149. on getPresentCard
  150.   global currentPerson,currentmatches
  151.   put bkgnd fld "Matches" into currentmatches
  152.   repeat with x=1 to 47
  153.     put "NONE" into item x of currentPerson
  154.   end repeat
  155.   repeat with x=1 to 47
  156.     put bkgnd fld x into item x of currentPerson
  157.   end repeat
  158. end getPresentCard
  159.  
  160.  
  161. on calculateResults
  162.   global currentPerson,currentMatches
  163.   put 0 into total
  164.   put 0 into nowHave
  165.   if item 4 of currentPerson <> bkgnd fld "Sex" then
  166.     repeat with x=5 to 47
  167.       if item x of currentPerson is not empty then
  168.         if bkgnd fld x is not empty then
  169.           add 1 to total
  170.           if bkgnd fld x is item x of currentPerson then add 1 to nowHave
  171.         end if
  172.       end if
  173.     end repeat
  174.     repeat with x=1 to 5
  175.       if item 1 of line x of bkgnd fld "Matches" <= 100*(nowHave/total) then
  176.         put ",,"&return before line x of bkgnd fld "matches"
  177.         put 100*(nowHave/total) into item 1 of line x of bkgnd fld "Matches"
  178.         put item 1 of currentPerson into line x of item 2 of bkgnd fld "Matches"
  179.         put item 3 of currentPerson into line x of item 3 of bkgnd fld "Matches"
  180.         if the number of lines in bkgnd fld "Matches" > 5 then delete line 6 of bkgnd fld "matches"
  181.         repeat with y=1 to 5
  182.           if item 1 of line y of currentMatches <= 100*(nowHave/total) then
  183.             put ",,"&return before line y of currentMatches
  184.             put 100*(nowHave/total) into item 1 of line y of currentMatches
  185.             put bkgnd fld 1 into item 2 of line y of currentMatches
  186.             put bkgnd fld 3 into item 3 of line y of currentMatches
  187.             if the number of lines in currentMatches > 5 then delete line 6 of currentMatches
  188.             exit repeat
  189.           end if
  190.         end repeat
  191.         exit repeat
  192.       end if
  193.     end repeat
  194.   end if
  195. end calculateResults
  196.  
  197.  
  198.  
  199. -- part 7 (button)
  200. -- low flags: 00
  201. -- high flags: 2000
  202. -- rect: left=295 top=246 right=266 bottom=436
  203. -- title width / last selected line: 0
  204. -- icon id / first selected line: 0 / 0
  205. -- text alignment: 1
  206. -- font id: 0
  207. -- text size: 12
  208. -- style flags: 0
  209. -- line height: 16
  210. -- part name: Build New Database
  211. ----- HyperTalk script -----
  212. on mouseUp
  213.   visual effect scroll down
  214.   go to bkgnd "Database"
  215.   domenu "New Stack..."
  216.   set the script of this stack to "DATABASE"
  217. end mouseUp
  218.  
  219.